import com.adobe.cairngorm.control.CairngormEventDispatcher;

import mx.events.ListEvent;

import net.optix.ip.events.GetBidCopyrightsEvent;
import net.optix.ip.model.ModelLocator;
import net.optix.ip.vo.CopyrightVO;

import views.ViewInstance;

[Bindable]
private var model:ModelLocator	=	ModelLocator.getInstance();

[Bindable]
private var copyright:CopyrightVO;

private function initApp():void
{
	var getBids:GetBidCopyrightsEvent	=	new GetBidCopyrightsEvent(model.firm.firmID);
	com.adobe.cairngorm.control.CairngormEventDispatcher.getInstance().dispatchEvent(getBids);
}
private function selectCopyright(event:Event):void
{
	try
	{
		copyright	=	CopyrightVO(event.target.selectedItem);	
		
	}
	catch(error:Error)
	{
		trace(error.getStackTrace());
	}
	if(event.type == ListEvent.ITEM_DOUBLE_CLICK)
	{
		model.currentCopyright	=	copyright;
		model.view	=	0;
		model.view	=	ViewInstance.ViewCopyRight;
		model.oldView	=	ViewInstance.ViewCopyrightBids;
		
	}
	else if(event.type == ListEvent.ITEM_CLICK)
	{
		intShow	=	0;
	}
}

[Bindable]
private var intShow:int	=	-1;

private function showRecord():void
{
	intShow	=	1;
}

private function showRight():void
{
	intShow	=	0;
}